# $Id$
# Maintainer: Pierre Schmitz <pierre@archlinux.de>
# Contributor: Douglas Soares de Andrade <douglas@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>

pkgname=lynx
pkgver=2.8.8
_relver=${pkgver}rel.2
pkgrel=5
pkgdesc="A text browser for the World Wide Web"
url="http://lynx.browser.org/"
arch=('i686' 'x86_64')
license=('GPL')
depends=('openssl' 'libidn')
backup=('etc/lynx.cfg')
source=(http://invisible-mirror.net/archives/lynx/tarballs/${pkgname}${_relver}.tar.bz2{,.asc}
        lynx-2.8.8-openssl.patch)
sha256sums=('6980e75cf0d677fd52c116e2e0dfd3884e360970c88c8356a114338500d5bee7'
            'SKIP'
            '08a331c9fc07547f5a59c9b83077bf18ece0a6012d77a6f3e0dff2be27a07769')
validpgpkeys=('0AFD1FFEEA2EA063B959ACDA5DDF8FB7688E31A6')

prepare() {
  cd ${srcdir}/${pkgname}${pkgver//./-}
  patch -Np1 -i ../lynx-2.8.8-openssl.patch
}
  
build() {
  cd ${srcdir}/${pkgname}${pkgver//./-}
  ./configure --prefix=/usr \
    --sysconfdir=/etc \
    --with-ssl=/usr \
    --enable-nls \
    --enable-ipv6 \
    --mandir=/usr/share/man
  make
}

package() {
  cd ${srcdir}/${pkgname}${pkgver//./-}
  make DESTDIR=${pkgdir} install

  # FS#20404 - points to local help
  sed -i -e "s|^HELPFILE.*$|HELPFILE:file:///usr/share/doc/lynx/lynx_help/lynx_help_main.html|" ${pkgdir}/etc/lynx.cfg

  install -d ${pkgdir}/usr/share/doc/lynx
  cp -rf lynx_help ${pkgdir}/usr/share/doc/lynx
}
